/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sporejava;

/**
 *
 * @author tommystaying
 */
public class Carnivore extends Animal{

    public Carnivore(String nomEspece,  String nom, String baseAdn, int identifiant, String ADN, int[] position) {
        super(nomEspece,  nom, baseAdn, identifiant, ADN, position);
    }

    @Override
    public void manger(EtreVivant etreVivant) {
        if(etreVivant instanceof Animal && !etreVivant.getNomEspece().equals(this.getNomEspece())){
            etreVivant.setSante(0);
            this.setNivFaim(100);
        }
    }

    @Override
     public EtreVivant reproduction(EtreVivant e) {
         if(!((Animal)e).getSexe().equals(this.getSexe()) && e.getNomEspece().equals(this.getNomEspece()) ){
            
        
        EtreVivant fils = new Carnivore(this.getNomEspece(),"",this.getBaseADN(),this.getIdentifiant(), this.getADN(), this.getPosition());
        return fils;
        }
        return null;
    }

    
    
}
